We develop a theory of convex cocompact subgroups of the mapping class group MCG of a closed, oriented surface S of genus at least 2, in terms of the action on Teichmuller space. Given a subgroup G of MCG defining an extension L_G: 1--> pi_1(S) --> L_G --> G -->1 we prove that if L_G is a word hyperbolic group then G is a convex cocompact subgroup of MCG. When G is free and convex cocompact, called a "Schottky subgroup" of MCG, the converse is true as well; a semidirect product of pi_1(S) by a free group G is therefore word hyperbolic if and only if G is a Schottky subgroup of MCG. The special case when G=Z follows from Thurston's hyperbolization theorem. Schottky subgroups exist in abundance: sufficiently high powers of any independent set of pseudo-Anosov mapping classes freely generate a Schottky subgroup.